<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

	<ui:composition 
	  xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      template="/templates/templateLayout.xhtml">
      
      <ui:define name="conteudo">
      <link rel="stylesheet" type="text/css" href="./estilos.css"/>  	
  	
<h:form prependId="false">    
    <p:panel id="idPanelConsultarProjeto" style="margin-left:10%; margin-bottom:30px; width:80%;" >  
    	<f:facet name="header">
    		<h:outputText value="Consultar Projeto" styleClass="outputTextTitulo"/>
    	</f:facet>
        <p:growl id="messages" />   
        <h:panelGrid id="idPanelGridProjeto" columns="4" >  
            <h:outputLabel value="Código do Projeto:" styleClass="outputLabel"/>  
            <p:inputText value="#{projetoBean.projetoSelecionado.idProjeto}" styleClass="inputId" />  
  
            <p:outputLabel value="Nome do Projeto:" styleClass="outputLabel"/>  
            <p:inputText value="#{projetoBean.projetoSelecionado.nomeProjeto}" styleClass="inputDescricao" />  
            
            <h:outputLabel value="Data de início:" styleClass="outputLabel"/>  
            <p:inputText value="#{projetoBean.dtInicial}" styleClass="inputData"/>  
  
            <p:outputLabel value="Data final:" styleClass="outputLabel"/>  
            <p:inputText value="#{projetoBean.dtFinal}" styleClass="inputData"/>           
 
        </h:panelGrid>  
    </p:panel> 
    <p:commandButton value="Consultar" action="#{projetoBean.findProjeto}" update="idTabelaProjeto" style="margin-right:20px; margin-left:10%;" />  
    <p:commandButton value="Novo" action="#{projetoBean.novoProjeto}" style="margin-right:20px;" />
    <p:commandButton value="Limpar" action="#{projetoBean.clean}" update="idPanelGridProjeto"  style="margin-right:20px;" />
                 
    <p:dataTable id="idTabelaProjeto" value="#{projetoBean.listaProjeto}"  var="projeto" rowKey="#{projeto.idProjeto}" 
    			 selection="#{projetoBean.projetoSelect}" selectionMode="single" style="margin-left:10%; margin-right:10%; padding-top:30px; float:center; text-align:center">  
  
        <f:facet name="header">  
            Resultados da pesquisa
        </f:facet>  
 
        <p:column headerText="Nome do Projeto" style="width:31%">  
      		<p:outputLabel value="#{projeto.nomeProjeto}"/>
        </p:column>  
  
        <p:column headerText="Data de início" style="width:10%">  
          	<h:outputText value="#{projeto.dtInicial}" >
          		<f:convertDateTime dateStyle="medium"/>
          	</h:outputText>
        </p:column>       
  
        <p:column headerText="Data final" style="width:10%">  
          	<h:outputText value="#{projeto.dtFinal}">
          		<f:convertDateTime dateStyle="medium"/>
          	</h:outputText>
        </p:column>  
        
        <p:column headerText="Gerente" style="width:31%">  
          	<p:outputLabel value="#{projeto.usuario.nome}"/>
        </p:column> 
        
        <p:column headerText="Status" style="width:10%">  
          	<p:outputLabel value="#{projeto.status}"/>
        </p:column>         
        
         <p:column style="width:4%">  
         	<f:facet name="header">
         		<p:outputLabel value="Editar"/>
         	</f:facet>
         	<p:commandButton id="selectButtonEditar" action="#{projetoBean.viewProjeto}" icon="ui-icon-pencil" title="Detail">
                <f:setPropertyActionListener value="#{projeto}" target="#{projetoBean.projetoSelect}" />  
            </p:commandButton>  
        </p:column> 
        
        <p:column style="width:4%">  
        	<f:facet name="header">
         		<p:outputLabel value="Excluir"/>
         	</f:facet>
        	
         	<p:commandButton id="selectButtonDelete" action="#{projetoBean.excluirProjeto}" icon="ui-icon-trash" title="Delete">
                <f:setPropertyActionListener value="#{projeto}" target="#{projetoBean.projetoSelect}" />  
            </p:commandButton>  
        </p:column>
  
    </p:dataTable>  

</h:form> 

</ui:define>
</ui:composition>
